drop function get_users_by_id_func;

create or replace function get_users_by_id_func(user_id bigint)
    RETURNS TABLE
            (
                id         bigint,
                created_at timestamp with time zone
            )
    language plpgsql
as
$$
BEGIN
    RETURN QUERY
        SELECT u.id,
               u.created_at
        FROM users u
        WHERE u.id = user_id;
END
$$;